//
//  LBAddPhotoView.h
//  app
//
//  Created by 杨庆人 on 16/12/20.
//  Copyright © 2016年 广东联结电子商务有限公司. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <LBCoreKit/LBOSSService.h>
#import "LBUploadPhotoModel.h"
#import <LBUIKit/LBActionSheet.h>
// addPhotoView的item大小
#define LBPicturesMargin [[UIScreen mainScreen] bounds].size.width > 375 ? (([[UIScreen mainScreen] bounds].size.width - 2 * 15) - (4 - 1) * 10) / 4.0 : (([[UIScreen mainScreen] bounds].size.width - 2 * 15) - (3 - 1) * 10) / 3.0

typedef NS_ENUM(NSInteger, LBAddPhotoViewType) {
    LBAddPhotoTypeAuth = 0,  // 出现标题在item上，如企业认证
    LBAddPhotoTypeTask = 1,  // 没标题在item上，如发接任务
    LBAddQualifiedBs = 2,  // 标题在item下，如添加业务资质
};

@interface LBAddPhotoView : UIView

/**添加照片完毕之后的block*/
@property (nonatomic,copy)void(^updataViewHeightBlock)(NSMutableArray * dataArray);

/**自行处理删除照片逻辑的block*/
@property (nonatomic,copy)void(^delePhotoBlock)(LBUploadPhotoModel * model,NSIndexPath * indexPath);

@property (nonatomic,assign)CGFloat viewHeight;

@property (nonatomic,strong)NSMutableArray <LBUploadPhotoModel *>* photoArray;  // 照片数组

@property (nonatomic,strong)NSMutableArray <LBUploadPhotoModel *>* dataArray;   // 数据源，lastObject有可能是空的

/** 初始化 */
- (instancetype)initWithTitleName:(NSString *)itemName itemSize:(CGSize)itemSize left:(CGFloat)left right:(CGFloat)right maxCount:(NSInteger)maxCount OSSCode:(LBServiceOSSCode)OSSCode photoViewType:(LBAddPhotoViewType)photoViewType;


/** 初始化，默认size适配屏幕（即iPhone5、6适配三张，plus适配四张） */
- (instancetype)initWithTitleName:(NSString *)itemName
                         maxCount:(NSInteger)maxCount
                          OSSCode:(LBServiceOSSCode)OSSCode
                    photoViewType:(LBAddPhotoViewType)photoViewType;


-(void)reloadData;

// 照片填充
- (void)setAddPhotoViewWithImageUrlArray:(NSArray *)imageUrlArray;

// 设置不可编辑状态
- (void)setUnEditable;

// 手动设置ServiceOSSCode
- (void)resetServerOSSCode:(LBServiceOSSCode )ossCode;

// 手动调用删除照片
- (void)delePhotoActionWithDeIndex:(NSIndexPath * )deIndexPath;



@end
